package com.ruoyi.module.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.module.domain.GoodsBrand;
import com.ruoyi.module.mapper.GoodsBrandMapper;
import com.ruoyi.module.service.IGoodsBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 品牌Service业务层处理
 *
 * @author fubojin
 * @date 2024-12-06
 */
@Service
public class GoodsBrandServiceImpl implements IGoodsBrandService
{
    @Autowired
    private GoodsBrandMapper goodsBrandMapper;

    /**
     * 查询品牌
     *
     * @param id 品牌主键
     * @return 品牌
     */
    @Override
    public GoodsBrand selectGoodsBrandById(String id)
    {
        return goodsBrandMapper.selectGoodsBrandById(id);
    }

    /**
     * 查询品牌列表
     *
     * @param goodsBrand 品牌
     * @return 品牌
     */
    @Override
    public List<GoodsBrand> selectGoodsBrandList(GoodsBrand goodsBrand)
    {
        return goodsBrandMapper.selectGoodsBrandList(goodsBrand);
    }

    /**
     * 新增品牌
     *
     * @param goodsBrand 品牌
     * @return 结果
     */
    @Override
    public int insertGoodsBrand(GoodsBrand goodsBrand)
    {
        goodsBrand.setCreateTime(DateUtils.getNowDate());
        return goodsBrandMapper.insertGoodsBrand(goodsBrand);
    }

    /**
     * 修改品牌
     *
     * @param goodsBrand 品牌
     * @return 结果
     */
    @Override
    public int updateGoodsBrand(GoodsBrand goodsBrand)
    {
        return goodsBrandMapper.updateGoodsBrand(goodsBrand);
    }

    /**
     * 批量删除品牌
     *
     * @param ids 需要删除的品牌主键
     * @return 结果
     */
    @Override
    public int deleteGoodsBrandByIds(String[] ids)
    {
        return goodsBrandMapper.deleteGoodsBrandByIds(ids);
    }

    /**
     * 删除品牌信息
     *
     * @param id 品牌主键
     * @return 结果
     */
    @Override
    public int deleteGoodsBrandById(String id)
    {
        return goodsBrandMapper.deleteGoodsBrandById(id);
    }
}
